import axios from 'axios'
import { baseUrl} from '../helper/helper1.js'
import Loading from '../helper/loading.js'

const ajax =(pas) => {

    Loading.show()
    // console.log(params)
   axios({
       url:pas.url,
       method: pas.method, 
       params: pas.params,
       data: pas.data,
   }).then( res =>{
       pas.success(res.data)
       
       Loading.hide()
   }).catch( err =>{

       Loading.hide()
   })

}


export default ajax